package marina.Services;

import java.util.ArrayList;
import java.util.Scanner;

import marina.interfaces.J24ProfessorDAO;
import marina.interfaces.J24ProfessorService;
import marina.model.J24ProfessorVO;

public class J24ProfessorServiceImpl implements J24ProfessorService {

	private J24ProfessorDAO pdao;
	
	public J24ProfessorServiceImpl(){
		pdao = new J24ProfessorDAOImpl();
	}
	
	@Override
	public void newProfessor() {
		Scanner sc = new Scanner(System.in);
		J24ProfessorVO pvo = new J24ProfessorVO(sc.next(), sc.next(), sc.next());
		System.out.println(pdao.insertProfessor(pvo));
	}

	@Override
	public void readProfessor() {
		ArrayList<J24ProfessorVO> pvoes = new ArrayList<>();
		pvoes = pdao.selectProfessor();
		for( J24ProfessorVO p: pvoes ){
			System.out.println(p);
		}
	}

	@Override
	public void readOneProfessor() {
		String pfno = "";
		ArrayList<J24ProfessorVO> pvoes = new ArrayList<>();
		pvoes = pdao.selectOneProfessor(pfno);
	}

	@Override
	public void modifyProfessor() {
		String pfno = "";
		System.out.println(pdao.updateProfessor(pfno));
	}

	@Override
	public void removeProfessor() {
		String pfno = "";
		System.out.println(pdao.deleteProfessor(pfno));
	}

}
